// components/blog-post/blog-post.js
Component({
  /**
   * Component properties
   */
  properties: {
    post: {
      type: Object,
      value: {}
    },
    showExcerpt: {
      type: Boolean,
      value: true
    },
    layout: {
      type: String,
      value: 'card' // 'card', 'list', 'compact'
    }
  },

  /**
   * Component initial data
   */
  data: {

  },

  /**
   * Component methods
   */
  methods: {
    onPostTap() {
      const post = this.properties.post;
      this.triggerEvent('posttap', { id: post.id });
    },
    
    onLikeTap(e) {
      // Stop event propagation to prevent triggering the onPostTap
      e.stopPropagation();
      const post = this.properties.post;
      this.triggerEvent('liketap', { id: post.id });
    },
    
    onShareTap(e) {
      // Stop event propagation to prevent triggering the onPostTap
      e.stopPropagation();
      const post = this.properties.post;
      this.triggerEvent('sharetap', { id: post.id });
    }
  }
})